﻿using System;
using System.Collections.Generic;

using System.Text;

namespace DotNETX.Authentication
{
    /// <summary>
    /// 用户认证
    /// </summary>
    public interface IAuthenticater
    {
        /// <summary>
        /// 登录接口
        /// </summary>
        /// <param name="loginId"></param>
        /// <param name="pwd"></param>
        /// <returns>
        /// token(may be guid)
        /// if return "null" indicate that login failed
        /// </returns>
        string Login(string loginId, string pwd);

        /// <summary>
        /// 注销登录
        /// </summary>
        /// <param name="token"></param>
        /// <returns>
        /// 0:success
        /// </returns>
        int Logout(string token);

        /// <summary>
        /// 获取用户唯一身份标志(UniqueId)
        /// </summary>
        /// <param name="token"></param>
        /// <returns>user's unique identifier</returns>
        string GetUId(string token);

        ITokenManager TokenManager { get; set; }

        IUserManager UserManager { get; set; }
    }
}
